<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户登录</title>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="js/layui/css/layui.css">
    <script src="js/jquery/jquery.min.js"></script>
    <script src="js/jquery.validation/1.14.0/jquery.validate.min.js"></script>
    <script src="js/jquery.validation/1.14.0/messages_zh.min.js"></script>
    <script src="js/layer/layer.js" charset="utf-8"></script>
    <script src="js/layui/layui.js" charset="UTF-8"></script>
</head>
<body>
<form class="layui-form" action="/user/login" method="post">
    <div class="layui-form-item">
        <label class="layui-form-label" id="name">用户名</label>
        <div class="layui-input-block">
            <input type="text" name="name" required  lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" id="password">密码框</label>
        <div class="layui-input-inline">
            <input type="password" name="password" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
        </div>
        <div class="layui-form-mid layui-word-aux">辅助文字</div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
<script>
//    //Demo
//    layui.use('form', function(){
//        var form = layui.form();
//
//        //监听提交
//        form.on('submit(formDemo)', function(data){
//            layer.msg(JSON.stringify(data.field));
//            //往服务器端发送数据
//            $.ajax({
//                type:"GET",
//                url:"/user/login",
//                dataType:"json",
//                data: {
//                    name: $("#name").val(),
//                    password: $("#password").val()
//                },
//                success:function(data){
//                        alert(data);
//                        //成功后跳转到商品界面
//                        /*/!* getGoodsPageList();*!/
//                        if($("name").val()==data.name&&$("password").val()==data.password){
//                            window.location.href='/goods.html';
//                        }*/
//                        window.location.href='/goods.html';
//                    }
//
//            })
//            return false;
//        });
//    });


</script>
</body>
</html>